<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>申请合作</title>
    <link rel="stylesheet" href="/js/elementui/index.css">
</head>
<body>
<div id="app">
    <el-row class="demo-avatar demo-basic">
    <template>
        <el-col :span="12">
            <div class="demo-basic--circle">
                <div class="block"><el-avatar shape="square" :size="50" :src="squareUrl"></el-avatar></div>
                <div class="block" v-for="size in sizeList" :key="size">
                    <el-avatar shape="square" :size="size" :src="squareUrl"></el-avatar>
                </div>
            </div>
        </el-col>
    </template>
    </el-row>
    <span>企业名称：{{customer.name}}</span> <br>
    <span>企业类型：</span>
    <span>经营范围:{{customer.business}}</span>
    <span>申请时间:{{customer.createTime}}</span>
    <span>状态：</span>
    <span>申请人姓名:</span>
    <span>成立日期:{{localeDate}}</span><br>
    <span>电子邮箱：</span>
    <span>固定电话：</span>
    <span>平台积分:</span>
    <span>详细地址:{{customer.address}}</span>
    <!--企业简介-->
    <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="企业简介">
        <el-input type="textarea" v-model="form.desc"></el-input>
    </el-form-item>
    </el-form>
    <!--申请成为-->
    <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="申请成为">
            <el-form-item label="">
                <el-radio-group v-model="form.resource">
                    <el-radio label="客户"></el-radio>
                    <el-radio label="供应商"></el-radio>
                </el-radio-group>
            </el-form-item>
            <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
    </el-form>


    <!--按钮 -->
    <el-row>
    <el-button type="primary" @click="submitContract">发送</el-button>
        <el-button type="info" @click="back">返回</el-button>
    </el-row>
</div>


<script src="/js/vue/vue.js"></script>
<script src="/js/axios/axios.min.js"></script>
<script src="/js/qs/qs.min.js"></script>
<script src="/js/elementui/index.js"></script>
<script src="/js/city/city.js"></script>
<script>
    new Vue({
        el:'#app',
        data(){
            return{
               customer: null,
                squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
                localeDate:'',
                //输入框中的类容
                state2: '',
                form: {
                    name: '',
                    region: '',
                    date1: '',
                    date2: '',
                    delivery: false,
                    type: [],
                    resource: '',
                    desc: ''
                }
            }
        },
        methods:{
           loginCustomer(){
               axios.get("/customer1").then(value => {
                   if(value.data.code==1){
                       this.customer=value.data.data
                   }

               })
           },
            submitContract(){
                axios.post("/addTpar/"+this.customer.id).then(value => {
                    console.log(this.customer.id)
                    if(value.data.code==1){
                        this.$message({
                            type: '',
                            message:'提交成功'
                        })
                    }
                })
            },
            back(){
                window.location.href="javascript:history.go(-1)";
            }
        },
        mounted() {
            this.loginCustomer()
            let myDate = new Date()
            this.localeDate = myDate.toLocaleDateString()
            console.log(this.localeDate)
        }
    })
</script>
</body>

</html>